#include <cmath>
#include <errno.h>
#include <fstream>
#include <iostream>

int main() {
  std::fstream binfile;
  binfile.open("data.dat", std::ios::binary | std::ios::out | std::ios::trunc);
  if (!binfile) {
    std::cout << "open data.dat: " << strerror(errno) << std::endl;
    return 1;
  }

  for (int i = 1; i <= 100; i++) {
    binfile << sqrt(i) << std::endl;
  }

  binfile.close();
}